// JavaScript Document

function show_tabscontent(catename,boxname)
{
		var cname = $("."+catename);
		cname.css({"font-weight":"700"}).siblings().css({"font-weight":"400"});
		$("#"+boxname).html("<li>正在获取数据...</li>");
		setTimeout(function(){return show_tabscontent_action(catename,boxname)},500);
}

function show_tabscontent_action(catename,boxname)
{
		var cname = $("#"+catename),box = $("#"+boxname);
		if(cname.html() == "")
		{
				box.html("暂时没有任何内容!!");
		}
		else
		{
				box.html(cname.html());
		}
}

function show_ajaxchange_tabs(cname,bname,cid,dtype,num)
{
		$("#"+boxname).html("<li>正在获取数据...</li>");
		setTimeout(function(){return show_ajaxchange_tabs_action(cname,bname,cid,dtype,num)},2000);
}

function show_ajaxchange_tabs_action(catename,boxname,cid,datatype,nums)
{
		box = $("#"+boxname);
		var message = "";
		if(isNaN(cid) || isNaN(nums)) 
		{
				message = "<li>提交请求时参数遇到错误!!</li>";
				box.html(message);
		}
		else
		{
				$.post("include/ajaxevents.php",{action:"ajaxTabsContent",typeid:cid,getnum:nums,types:datatype},
				function(data){
						if(data == "")
						{
								box.html("暂无任何内容!!");
						}
						else
						{
								box.html(data);
						}
				});
				
				box.ajaxError(function(event,request, settings){
						$(this).append("<li>出错信息:" + settings.url + "</li>");
				});
		}
}